home *** CD-ROM | disk | FTP | other *** search
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 19.02.98 - 23:38:39 $ =}
- {========================================================================}
- unit MMCDATyp;
-
- {$I COMPILER.INC}
-
- interface
-
- uses
- Windows,
- MMSystem,
- MMSCSI;
-
- const
- SECTOR_LEN = 2368;
- FRAME_SIZE = 2352;
- DATA_SECTOR = 2048;
- TIMEOUT = 10000;
- FRAME_OFFSET = 150;
- SINGLE_SPEED = 75*FRAME_SIZE;
-
- type
- THCDDA = integer;
-
- PASPIDeviceInfo = ^TASPIDeviceInfo;
- TASPIDeviceInfo = packed record
- Adapter : integer; // haId
- TargetId : integer;
- LUN : Integer;
- Data : TScsiInquiry;
- lpNext : PASPIDeviceInfo;
- end;
-
- {==========================================================================}
- PASPIInfo = ^TASPIInfo;
- TASPIInfo = packed record
- FNumAdapters: Byte;
- FDevices : PASPIDeviceInfo;
- end;
-
- {==========================================================================}
- TCDTrackType = (ttData,ttAudio);
-
- {==========================================================================}
- PCDTrackInfo = ^TCDTrackInfo;
- TCDTrackInfo = packed record
- Number : Integer;
- Start : Integer; // MSF
- Length : Integer; // MSF
- TrackType : TCDTrackType;
- CopyProtected : LongBool;
- PreEmphasis : LongBool;
- end;
-
- {==========================================================================}
- PCDTrackList = ^TCDTrackList;
- TCDTrackList = packed record
- nTracks: Integer;
- Tracks : array[0..99] of TCDTrackInfo;
- end;
-
- const
- AUTO = 'AutoDetect';
- ATAPI = 'ATAPI';
- CYBER = 'CYBER';
- DEC_ = 'DEC';
- GRUNDIG = 'GRUNDIG';
- HITACHI = 'HITACHI';
- HP = 'HP';
- IBM = 'IBM';
- IMS = 'IMS';
- KODAK = 'KODAK';
- MATSHITA = 'MATSHITA';
- MITSUMI = 'MITSUMI';
- MP = 'MP';
- MS = 'MS';
- NEC = 'NEC';
- PHILIPS = 'PHILIPS';
- PIONEER = 'PIONEER';
- PLASMON = 'PLASMON';
- PLEXTOR = 'PLEXTOR';
- RICOH = 'RICOH';
- SONY = 'SONY';
- TOSHIBA = 'TOSHIBA';
- TEAC = 'TEAC';
- YAMAHA = 'YAMAHA';
-
- type
- {==========================================================================}
- TCDDeviceType = (dtAUTO,
- dtATAPI,
- dtCYBER,
- dtDEC,
- dtGRUNDIG,
- dtHITACHI,
- dtHP,
- dtIBM,
- dtIMS,
- dtKODAK,
- dtMATSHITA,
- dtMITSUMI,
- dtMP,
- dtMS,
- dtNEC,
- dtPHILIPS,
- dtPIONEER,
- dtPLASMON,
- dtPLEXTOR,
- dtRICOH,
- dtSONY,
- dtTOSHIBA,
- dtTEAC,
- dtYAMAHA);
- const
- {==========================================================================}
- CDDeviceTypes: array[0..23] of string =
- (AUTO,
- ATAPI,
- CYBER,
- DEC_,
- GRUNDIG,
- HITACHI,
- HP,
- IBM,
- IMS,
- KODAK,
- MATSHITA,
- MITSUMI,
- MP,
- MS,
- NEC,
- PHILIPS,
- PIONEER,
- PLASMON,
- PLEXTOR,
- RICOH,
- SONY,
- TOSHIBA,
- TEAC,
- YAMAHA);
-
-
- const
- {==========================================================================}
- { ASPI Error codes }
- {==========================================================================}
- ASPI_ERRBASE = -100;
- ASPI_NOERROR = 0;
- ASPI_DLLERROR = ASPI_ERRBASE - 1;
- ASPI_NOMANAGER = ASPI_ERRBASE - 2;
- ASPI_NOADAPTER = ASPI_ERRBASE - 3;
- ASPI_INVALIDDEVICE = ASPI_ERRBASE - 4;
- ASPI_TIMEOUT = ASPI_ERRBASE - 5;
- ASPI_UNKNOWNERROR = ASPI_ERRBASE - 6;
-
- {==========================================================================}
- { CDDA Error codes }
- {==========================================================================}
- CDDA_ERRBASE = 0;
- CDDA_NOERROR = CDDA_ERRBASE;
- CDDA_INITFAILURE = CDDA_ERRBASE - 1;
- CDDA_INVALHANDLE = CDDA_ERRBASE - 2;
- CDDA_INVALPARAM = CDDA_ERRBASE - 3;
- CDDA_INVALIDDEVICE = CDDA_ERRBASE - 4;
- CDDA_ALLOCATED = CDDA_ERRBASE - 5;
- CDDA_NOTREADY = CDDA_ERRBASE - 6;
- CDDA_CANNOTOPEN = CDDA_ERRBASE - 7;
- CDDA_CANNOTCLOSE = CDDA_ERRBASE - 8;
- CDDA_CANNOTLOAD = CDDA_ERRBASE - 9;
- CDDA_CANNOTPLAY = CDDA_ERRBASE - 10;
- CDDA_CANNOTPAUSE = CDDA_ERRBASE - 11;
- CDDA_CANNOTRESUME = CDDA_ERRBASE - 12;
- CDDA_CANNOTSTOP = CDDA_ERRBASE - 13;
- CDDA_CANNOTLOCK = CDDA_ERRBASE - 14;
- CDDA_CANNOTREAD = CDDA_ERRBASE - 15;
- CDDA_SYNCERROR = CDDA_ERRBASE - 16;
- CDDA_UNKNOWNERROR = CDDA_ERRBASE - 17;
-
- function MSFToFrame(MSF: Longint): Longint;
- function Frame2MSF(Frame: Longint; M, S, F: PInteger): Longint;
- function FrameToMSF(Frame: Longint): Longint;
-
- implementation
-
- {==============================================================================}
- function MSFToFrame(MSF: Longint): Longint;
- begin
- Result := MCI_MSF_FRAME(MSF);
- Result := Result + 75 * MCI_MSF_SECOND(MSF);
- Result := Result + 75 * 60 * MCI_MSF_MINUTE(MSF);
- end;
-
- {==============================================================================}
- function Frame2MSF(Frame: Longint; M, S, F: PInteger): Longint;
- var
- Temp : Integer;
- begin
- Temp:= (Frame mod 75);
- if (F <> nil) then F^:= Temp;
- Result:= Temp shl 16;
-
- Temp:= Frame div 75;
- Result:= Result or (Temp div 60);
- Temp:= Temp mod 60;
- if (M <> nil) then M^:= Result and $FF;
-
- if (S <> nil) then S^:= Temp;
- Result:= Result or (Temp shl 8);
- end;
-
- {==============================================================================}
- function FrameToMSF(Frame: Longint): Longint;
- var
- M,S,F: integer;
- begin
- Frame2MSF(Frame, @M, @S, @F);
- Result := MCI_MAKE_MSF(M, S, F);
- end;
-
- end.
-